<template>
	<tm-app color="#efefef">		
			<view class="flex flex-between pl-30 FormM1">
				<navbar-module title="已服务工单" :transprent="true"></navbar-module>
			</view> 
			<tm-sheet :padding="[2,2]" style="margin-top:-200rpx">
				<view class="flex flex-start px-26 pt-20">
					<tm-icon name="tmicon-ios-filing" color="#23C343" class="mr-15" :font-size="32"/>
					<tm-text :label="itemData.data.code" :fontSize="32" class="text-weight-b"/>
				</view>
				
				<view class="px-26 py-20 flex flex-center flex-col">
					<tm-text label='查看猪猪服务视频' :fontSize="32" class="py-16" @click="goto" color="blue"></tm-text>
				</view>
				
				<tm-cell bottomBorder :margin="[0,0]" title="猪仔名称" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{itemData.data.pig.name}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell bottomBorder :margin="[0,0]" title="所属猪圈" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{itemData.data.pig.pigsty.name}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell v-if="isManage" bottomBorder :margin="[0,0]" title="负责人" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{itemData.data.staff.name}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell bottomBorder :margin="[0,0]" title="服务项目" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{itemData.data.content.combo.name}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell bottomBorder :margin="[0,0]" title="服务描述:" :titleFontSize="32">
					<template v-slot:right></template>
				</tm-cell>
				<tm-text style="margin: 10rpx 20rpx;text-indent: 2rem;" :label="itemData.data.content.combo.description" :fontSize="32"/>
				
				<tm-cell bottomBorder :margin="[0,0]" title="完成时间" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{itemData.data.completeTime}}</tm-text>
					</template>
				</tm-cell>
			</tm-sheet>
	</tm-app>
</template>

<script setup lang='ts'>
import { reactive, ref, computed } from "vue";
import { onLoad } from '@dcloudio/uni-app'
 
    const isManage = uni.getStorageSync('isManage')

	const itemData = reactive({data:{}})
	
	onLoad((option)=>{
		itemData.data = JSON.parse(decodeURIComponent(option.data))
	})
	
	const goto = () => {
		uni.navigateTo({
			url:`/pages/video/video?src=${itemData.data.video}`
		})
	}
	



</script>

<style>

</style>
